Skip to content

fix(cli): sandbox get returns currently active runtime policy#880

Merged
TaylorMutch merged 3 commits intomainfrom
tmutch/include-runtime-policy-revision-sandbox-get-output
Apr 20, 2026
Merged

fix(cli): sandbox get returns currently active runtime policy#880
TaylorMutch merged 3 commits intomainfrom
tmutch/include-runtime-policy-revision-sandbox-get-output

Conversation

@TaylorMutch
Copy link
Copy Markdown
Collaborator

@TaylorMutch TaylorMutch commented Apr 17, 2026

Summary

Fixes the root cause described in #837: openshell sandbox get now fetches the effective runtime policy via GetSandboxConfig for all output modes — including hot-reloaded updates and gateway-global overrides. The base output also surfaces the policy source (sandbox or global) and revision number, so callers no longer need to stitch together sandbox get and policy get --full output.

A --policy-only flag is also added for scripting workflows:

openshell sandbox get my-sandbox --policy-only > current.yaml
# edit current.yaml, then:
openshell policy set my-sandbox --policy current.yaml --wait

Related Issue

Fixes #837

Changes

  • sandbox get now always calls GetSandboxConfig to retrieve the active runtime policy (replaces creation-time spec lookup)
  • Base output now includes Policy source (sandbox/global) and Revision fields
  • Added --policy-only flag to openshell sandbox get; when set, prints only the active policy YAML to stdout
  • Added sandbox_get_policy_only_round_trip integration test; updated get_sandbox_config mock to return a real SandboxPolicy
  • Updated CLI reference docs and docs/sandboxes/manage-sandboxes.mdx with the new flag and updated output

Testing

  • mise run pre-commit passes
  • Unit tests added/updated (sandbox_get_policy_only_round_trip)
  • E2E tests added/updated (if applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

@TaylorMutch TaylorMutch self-assigned this Apr 17, 2026
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Apr 17, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 17, 2026

All contributors have signed the DCO ✍️ ✅
Posted by the DCO Assistant Lite bot.

@TaylorMutch TaylorMutch added the test:e2e Requires end-to-end coverage label Apr 17, 2026
@TaylorMutch TaylorMutch force-pushed the tmutch/include-runtime-policy-revision-sandbox-get-output branch from a632319 to 19be372 Compare April 20, 2026 15:51
@TaylorMutch TaylorMutch force-pushed the tmutch/include-runtime-policy-revision-sandbox-get-output branch from 19be372 to 3a7b177 Compare April 20, 2026 16:42
@github-actions
Copy link
Copy Markdown

@TaylorMutch TaylorMutch changed the title feat(cli): show active runtime policy when retrieving sandbox feat(cli): add --policy-only flag to sandbox get Apr 20, 2026
@TaylorMutch TaylorMutch changed the title feat(cli): add --policy-only flag to sandbox get fix(cli): sandbox get now shows live runtime policy with source and revision Apr 20, 2026
@TaylorMutch TaylorMutch changed the title fix(cli): sandbox get now shows live runtime policy with source and revision fix(cli): sandbox get returns currently active runtime policy Apr 20, 2026
@TaylorMutch TaylorMutch marked this pull request as ready for review April 20, 2026 17:27
@TaylorMutch TaylorMutch requested a review from a team as a code owner April 20, 2026 17:27
@TaylorMutch
Copy link
Copy Markdown
Collaborator Author

I have read the DCO document and I hereby sign the DCO.

@TaylorMutch TaylorMutch merged commit 9ac725f into main Apr 20, 2026
12 of 13 checks passed
@TaylorMutch TaylorMutch deleted the tmutch/include-runtime-policy-revision-sandbox-get-output branch April 20, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: include runtime policy revisions in sandbox get output

2 participants